package me.yobol.lintcode.easy.invertbt;

import me.yobol.lintcode.TreeNode;

/**
 *
 * @author Yobol
 */
public class InvertBinaryTreeInRecusion implements IInvertBinaryTree{

    /**
     * 
     * @param root 
     */
    @Override
    public void invertBinaryTree(TreeNode root) {
        if (root == null) {
            return ;
        }
        invertBinaryTree(root.left);
        invertBinaryTree(root.right);
        
        TreeNode temp = root.left;
        root.left = root.right;
        root.right = temp;
    }
    
}
